package com.zxw.user.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.zxw.common.core.base.res.BaseRes;
import com.zxw.user.domain.dto.MenuDTO;
import com.zxw.user.domain.entity.Menu;
import com.zxw.user.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Xuewei.Zhang
 * @since 2022-02-28
 */
@Api(tags = "菜单模块")
@RestController
@RequestMapping("/menu")
@RequiredArgsConstructor
public class MenuController {

    private final MenuService menuService;

    @ApiOperationSupport(author = "Xuewei.Zhang")
    @ApiOperation("获取菜单列表")
    @GetMapping("/menu-list")
    public BaseRes<List<MenuDTO>> menuList(Menu menu) {
        List<MenuDTO> menuList = menuService.getMenuTableList(menu);
        return BaseRes.ok(menuList);
    }



}
